<?php

/**
 * 首页
 *
 *
 * @author     Robot
 * @version    1.0
 * @package    Base Framework
 * @access     public
 * @copyright  商业软件,受著作权保护
 * @link       http://***
 */
class homeController extends Base
{
	/**
	 * 构造方法
	 *
	 * @var    boolean
	 * @access public
	 */
	public function __construct()
	{
		$this->smarty->assign("staticurl", STATIC_URL);
	}

	/**
	 * 首页
	 *
	 * @var    boolean
	 * @access public
	 */
	public function indexAction()
	{
		$this->smarty->assign("company", 1);
		$this->smarty->display("www/index.html");
	}

	/**
	 * 选油
	 *
	 * @var    boolean
	 * @access public
	 */
	public function startAction()
	{
		//从首页进入，需要清理session
		if(strpos($_SERVER['HTTP_REFERER'], '.html') === false)
		{
			$_SESSION['post'] = array();
		}

		if($_POST)
		{
			//存入session
			$_SESSION['post'] = $_POST;

			//参数检查
			$error = $this->user_postModule->checkPost($_SESSION['post']);
			if(is_string($error))
			{
				echo '<script type="text/javascript">alert("'.$error.'");</script>';
				exit;
			}

			$result = $this->user_postModule->getResult($_SESSION['post']);

			//数据不合法
			if($result['ret'] == '-1')
			{
				echo '<script type="text/javascript">alert("'.$result['result'].'");</script>';
				exit;
			}

			$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result['result'], $result['sql']);

			//结果过多
			if($result['ret'] != '1')
			{
				echo '<script type="text/javascript">top.location.href="/startn.html?id='.$id.'";</script>';
				exit;
			}

			//正确结果
			else
			{
				echo '<script type="text/javascript">top.location.href="/starty.html?id='.$id.'";</script>';
			}
		}

		Common::load("Form");

		$field = array(
			'tebieyaoqiu'=>array(
						'type'=>'checkbox',
						'options'=>array("1"=>"无毒123","2"=>"环保（可降解）456"),
						'class'=>'input_w1',
						'dnote'=>'可多选，无则无需选择',
						),
			'gongzuohuanjing'=>array(
						'type'=>'checkbox',
						'options'=>array("1"=>"湿度高","2"=>"粉尘大","3"=>"有明火或300度以上高温表面"),
						'class'=>'input_w1',
						'dnote'=>'可多选，无则无需选择',
						),
			'gongzuochangsuo'=>array(
						'type'=>'radio',
						'options'=>array("1"=>"室内","2"=>"室外","3"=>"室内室外皆有"),
						'empty'=>'请选择工作场所',
						'class'=>'input_w1',
						),
			'xitongyali_zuigaoyali'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-4',
						'note'=>'必填项，限：0~70Mpa',
						'error'=>'压力值区间限：0~70Mpa',
						'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'xitongyali_edingyali'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-4',
						'note'=>'必填项，限：0~70Mpa',
						'error'=>'压力值区间限：0~70Mpa',
						'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'zhubengleixing'=>array(
						'type'=>'radio',
						'options'=>array("1"=>"叶片泵","2"=>"柱塞泵","3"=>"齿轮泵","4"=>"螺杆泵"),
						'empty'=>'请选择主泵类型',
						'class'=>'input_w1',
						),
			'liuliangliusu_zhubengzuidaliulang'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-10',
						'note'=>'必填项',
						'error'=>'请填写正确的主泵最大流量',
						'empty'=>'请填写主泵最大流量',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'liuliangliusu_xitongzuidaliusu'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-10',
						'note'=>'必填项，限：0~20m/s',
						'error'=>'系统最大流速区间限：0~20m/s',
						'empty'=>'请填写系统最大流速',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'liuliangliusu_youxiangrongji'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-10',
						'note'=>'必填项',
						'error'=>'请填写正确的油箱容积',
						'empty'=>'请填写油箱容积',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'huanjingwendu_zuigao'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-4',
						'note'=>'必填项，限：0~50℃',
						'error'=>'最高值限：0~50℃',
						'empty'=>'请填写最高值',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'huanjingwendu_zuidi'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-5',
						'note'=>'必填项，限：-50~30℃',
						'error'=>'最低值限：-50~30℃',
						'empty'=>'请填写最低值',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'gongzuowendu_zuigao'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-5',
						'note'=>'必填项，限：-30~120℃',
						'error'=>'最高值限：-30~120℃',
						'empty'=>'请填写最高值',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'gongzuowendu_zuidi'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-5',
						'note'=>'必填项，限：-30~50℃',
						'error'=>'最低值限：-30~50℃',
						'empty'=>'请填写最低值',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'fazuleixing'=>array(
						'type'=>'checkbox',
						'options'=>array("1"=>"有伺服阀","2"=>"有比例阀"),
						'class'=>'input_w1',
						),
			'zhixingyuanjian'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-5',
						'note'=>'必填项，限：0~10m/s',
						'error'=>'最大线速度限：0~10m/s',
						'empty'=>'请填写最大线速度',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'yuanjianqingkuang'=>array(
						'type'=>'checkbox',
						'options'=>array("1"=>"系统元件中含铜","2"=>"系统元件中含银"),
						'class'=>'input_w1',
						'dnote'=>'可多选，无则无需选择',
						),
			'runhuayaoqiu'=>array(
						'type'=>'checkbox',
						'options'=>array("1"=>"液压系统与导轨润滑共用","2"=>"液压系统与齿轮润滑共用"),
						'class'=>'input_w1',
						'note'=>'可多选，无则无需选择',
						'dnote'=>'可多选，无则无需选择',
						),
			'jiechujiezhi'=>array(
						'type'=>'radio',
						'options'=>array("1"=>"工作介质有腐蚀","2"=>"工作介质无腐蚀"),
						'empty'=>'请选择接触介质',
						'class'=>'input_w1',
						),
			);
		$f = new Form($field, "/start.html");

		$this->smarty->assign("form", $f->getForm($_SESSION['post']));
		$this->smarty->display("www/start.html");
	}

	/**
	 * 选油-有结果
	 *
	 * @var    boolean
	 * @access public
	 */
	public function startyAction()
	{
		//发邮箱
		if($_POST['submit'] == '发 送')
		{
			$aRes = $this->user_postlogModule->getLog(intval($_POST['id']));
			if($aRes)
			{
				$aRes['postcontent'] = Common::assign($aRes['postcontent']);
				$aRes['nextpost'] = Common::assOther($aRes['nextpost'],$aRes["type"]);
			}
			$r = $this->user_mailModule->sendMail($_POST['mail'], $aRes);
			if($r)
			{
				$this->user_mailModule->add($_POST['id'], $_POST['mail']);
				echo "<script>parent.sendok()</script>";
				exit;
			}
			echo "<script>parent.senderror()</script>";
			exit;
		}

		$aRes = $this->user_postlogModule->getLog(intval($_GET['id']));
		if($aRes['cookie'] != $_COOKIE['PHPSESSID'])
		{
			Common::header("/");
		}
		if($aRes)
		{	
			// $aRes['postcontent'] = Common::assign($aRes['postcontent']);
			// $aRes['nextpost'] = Common::assOther($aRes['nextpost'],$aRes["type"]);
		}
		$this->smarty->assign("type", intval($_GET['type']));
		$this->smarty->assign("id", intval($_GET['id']));
		$this->smarty->assign("info", $aRes);
		$this->smarty->display("www/start_yes.html");
	}

	/**
	 * 选油-无结果
	 *
	 * @var    boolean
	 * @access public
	 */
	public function startnAction()
	{
		$aRes = $this->user_postlogModule->getLog(intval($_GET['id']));
		$this->smarty->assign("type", is_numeric(strpos($aRes['result'][0], "很抱歉")));
		$this->smarty->assign("id", intval($_GET['id']));
		$this->smarty->assign("result", $aRes['result'][0]);
		$this->smarty->display("www/start_no.html");
	}

	/**
	 * 寻求帮助
	 *
	 * @var    boolean
	 * @access public
	 */
	public function callspecialistAction()
	{
		if($_POST){
			$aRes = $this->user_postlogModule->getLog(intval($_POST['id']));
			if($aRes)
			{
				$aRes['postcontent'] = Common::assign($aRes['postcontent']);
				$aRes['nextpost'] = Common::assOther($aRes['nextpost'],$aRes["type"]);
			}
			$r = $this->user_mailModule->sendAdminMail($aRes,$_POST);
			if($r)
			{
				$this->user_mailModule->add($_POST['id'], $_POST['email']);
				echo "<script>alert('发送成功')</script>";
			}
			$_GET['id'] = $_POST["id"];
		}
		$aRes = $this->user_postlogModule->getLog(intval($_GET['id']));

		if($aRes['cookie'] != $_COOKIE['PHPSESSID'])
		{
			Common::header("/");
		}
		if($aRes)
		{
			$aRes['postcontent'] = Common::assign($aRes['postcontent']);
			$aRes['nextpost'] = Common::assOther($aRes['nextpost'],$aRes["type"]);
		}
		$this->smarty->assign("info", $aRes);
		$this->smarty->display("www/callspecialist.html");
	}

	/**
	 * 反馈意见
	 *
	 * @var    boolean
	 * @access public
	 */
	public function yijianAction()
	{
		Common::load("Form");

		if($_POST)
		{
			//发布成功
			if($this->user_feedbackModule->add($_POST) === true)
			{
				Common::packXml('<script>alert("您的反馈已成功提交，非常感谢您填写本表！");window.location.href="/"</script>');
			}

			//发布失败
			else
			{
				Common::packXml('');
			}
		}

		$field = array(
			'ganshou'=>array(
						'type'=>'textarea',
						'check'=>'String,10-500',
						'note'=>'请填写您的使用感受。限10~500字',
						'error'=>'限10~500个字',
						'empty'=>'请填写使用感受',
						'class'=>'wenben fl',
						),
			'jianyi'=>array(
						'type'=>'textarea',
						'check'=>'String,10-500',
						'note'=>'请填写您给我们的建议。限10~500字',
						'error'=>'限10~500个字',
						'empty'=>'请填写使用建议',
						'class'=>'wenben fl',
						),
			'username'=>array(
						'type'=>'text',
						'check'=>'String,3-30',
						'note'=>'请填写您在中国设备管理网的用户名',
						'error'=>'用户名不正确',
						'empty'=>'请填写用户名',
						'class'=>'text w2',
						),
			'email'=>array(
						'type'=>'text',
						'check'=>'Mail,5-30',
						'note'=>'请填写email',
						'error'=>'Email格式不正确',
						'empty'=>'请填写email',
						'class'=>'text w2',
						),
			'phone'=>array(
						'type'=>'text',
						'check'=>'String,5-30',
						'note'=>'请填写手机或座机',
						'error'=>'联系方式不正确',
						'empty'=>'请填写手机或座机',
						'class'=>'text w2',
						),
			);
		$f = new Form($field, "/yijian.html");

		$this->smarty->assign("form", $f->getForm($data));
		$this->smarty->assign("company", 1);
		$this->smarty->display("www/yijian.html");
	}

	public function firstAction(){
		//从首页进入，需要清理session
		if(strpos($_SERVER['HTTP_REFERER'], '.html') === false)
		{
			$_SESSION['post'] = array();
			unset($_SESSION['type']);
		}

		if($_POST)
		{
			//存入session
			$_SESSION['post'] = $_POST;
			//参数检查
			$error = $this->user_postModule->checkFirstPost($_SESSION['post']);
			if($error==-1){
				$result = "很抱歉，本系统暂未收录您需要的润滑剂资料,建议您直接联系本系统专家团队获取解决方案。";
				//记录日志
				$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result, "",array(),0);
			}
			if($error==-2){
				$result = "钢丝绳润滑工况特殊，为防止用户选择错误，本系统建议钢丝绳润滑剂一律采用钢索油，即钢丝绳专用润滑油脂。至于其它润滑油品用于钢丝绳润滑的问题，本系统专家团队已列为后续实践研究课题。  ";
				//记录日志
				$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result, "",array(),0);
			}
			if($id)
			{	
				echo '<script type="text/javascript">top.location.href="/startn.html?id='.$id.'";</script>';
				exit;
			}
			$_SESSION['type'] = 1;
			if($_POST["runhuayongtu"]=="A"&&in_array($_POST["runhuayongyu"], array("A","B"))){
				echo '<script type="text/javascript">top.location.href="/start_1.html";</script>';
				exit;
			}else if($_POST["runhuayongtu"]=="A"&&$_POST["runhuayongyu"]=="C"){
				echo '<script type="text/javascript">top.location.href="/start_2.html";</script>';
				exit;
			}else if($_POST["runhuayongtu"]=="B"&&in_array($_POST["runhuayongyu"], array("A","B"))){
				echo '<script type="text/javascript">top.location.href="/start_3.html";</script>';
				exit;
			}else if($_POST["runhuayongtu"]=="B"&&$_POST["runhuayongyu"]=="C"){
				echo '<script type="text/javascript">top.location.href="/start_4.html";</script>';
				exit;
			}else if(in_array($_POST["runhuayongtu"], array("C","D","E","G"))&&in_array($_POST["runhuayongyu"], array("A","B"))){
				echo '<script type="text/javascript">top.location.href="/start_5.html";</script>';
				exit;
			}else if(in_array($_POST["runhuayongtu"], array("C","D","E","G"))&&$_POST["runhuayongyu"]=="C"){
				echo '<script type="text/javascript">top.location.href="/start_6.html";</script>';
				exit;
			}
			echo '<script type="text/javascript">alert("您没有做任何选择，请选择后提交");</script>';
			exit;
		}

		Common::load("Form");

		$field = array(
			'industry'=>array(
						'type'=>'radio',
						'options'=>array("A"=>"采掘","B"=>"冶金","C"=>"水泥","D"=>"化工","E"=>"发电","F"=>"其它"),
						//'empty'=>'请选择所属行业',
						'class'=>'input_w1',
						),
			'drive_name'=>array(
						'type'=>'text',
						'check'=>'String,1-20',
						'note'=>'请输入名称',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'drive_model'=>array(
						'type'=>'text',
						'check'=>'String,1-20',
						'note'=>'请输入设备型号',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'drive_kw'=>array(
						'type'=>'text',
						'check'=>'Temperature,1-10',
						'note'=>'请输入设备功率',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'normal_c'=>array(
						'type'=>'select',
						'options'=>array(1=>"≤35",2=>"≤55",3=>"≤80",4=>"≤100",5=>"≤120",6=>"≤150",7=>"≥151"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'必填项',
						),
			'max_c'=>array(
						'type'=>'select',
						'options'=>array(1=>"≤40" , 2=>"≤60" ,3=> "≤80"  ,4=>"≤100" ,5=>"≤120"  ,6=>"≤130" ,7=> "≤150" ,8=> "≥151"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'必填项',
						),
			'min_c'=>array(
						'type'=>'select',
						'options'=>array(1=>"≥0", 2=>"≥一10" ,3=>"≥一20",4=>"≥一30",5=>"≥一40",6=>"≤一41"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'必填项',
						),
			'runhuajileibie'=>array(
						'type'=>'select',
						'options'=>array(1=>"齿轮油" , 2=>"液压油" ,3=> "润滑脂"  ,4=>"其它"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'必填项',
						),
			'changjiapinpai'=>array(
						'type'=>'select',
						'options'=>array(1=>"美孚" , 2=>"壳牌" ,3=> "长城"  ,4=>"昆仑",5=>"其它"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'必填项',
						),
			'guigexinghao'=>array(
						'type'=>'text',
						'check'=>'String',
						//'empty'=>'必填项',
						'class'=>'text w1',
						// 'note'=>'请输入规格型号',
						// 'dnote'=>'请务必填写完整，如“长城卓力L-HS超低温液压油32#”',
						),
			'ketidaiyou'=>array(
						'type'=>'text',
						'check'=>'String',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'note'=>'请输入可替代油',
						'dnote'=>'必填项',
						),
			'jiarezhi'=>array(
						'type'=>'select',
						'options'=>array(1=>"≥一20℃", 2=>"≥一10℃" ,3=>"≥0℃",4=>"≥10℃",5=>"≥20℃"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'必填项',
						),
			'lengquezhi'=>array(
						'type'=>'select',
						'options'=>array(1=>"≤40℃", 2=>"≤60℃" ,3=>"≤80℃",4=>"≤100℃",5=>"≤120℃",6=>"≤150℃",7=>"≥151℃"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'必填项',
						),
			'work_huanjing'=>array(
						'type'=>'checkbox',
						'options'=>array("A"=> "振动大" , "B"=> "腐蚀性物质" , "C"=> "潮湿"  ,"D"=> "低温(≤-20℃)" ,"E" =>"高温( ≥40℃)" ,"F"=> "室内" , "G" =>"室外" , "H"=> "污水" , "I"=> "灰尘" ,  "J"=> "颗粒" , "K"=> "其它特殊环境"),
						'dnote'=>'可多选，无则不选',
						'class'=>'input_w1',
						),
			'anquanyaoqiu'=>array(
						'type'=>'radio',
						'options'=>array("1"=>"阻燃","2"=>"毒性小"),
						//'empty'=>'安全要求',
						'class'=>'input_w1',
						),
			'huanbaoyaoqiu'=>array(
						'type'=>'radio',
						'options'=>array("1"=>"可降解","2"=>"无泄漏"),
						//'empty'=>'环保要求',
						'class'=>'input_w1',
						),
			'runhuaji'=>array(
						'type'=>'radio',
						'options'=>array("1"=>"及时补加比较困难","2"=>"只能在解体或检修时才能进行","3"=>"可随时视情况补充添加和更换"),
						//'empty'=>'润滑剂补充或更换操作',
						'class'=>'input_w1',
						),
			'niandudengji'=>array(
						'type'=>'select',
						'options'=>array("A"=>"油"  ,"B"=>"脂" ),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'请输入',
						),
			'ayou'=>array(
						'type'=>'select',
						'options'=>array(1=>"22"  ,2=>"32" ,3=>"46" ,4=>"68" ,5=>"100" ,6=>"150"  ,7=>"220" ,8=>"320" ,9=>" 460" ,10=>" 680"  ,11=>"1000"  ,12=>"1500"  ,13=>"不知道"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'hide'=>true,
						'dnote'=>'必填项',
						),
			'bzhi'=>array(
						'type'=>'select',
						'options'=>array(1=>"000"  ,2=>"00" ,3=>"0" ,4=>"1" ,5=>"2" ,6=>"3"  ,7=>"4" ,8=>"5" ,9=>" 6" ,10=>"不知道"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'hide'=>true,
						'dnote'=>'必填项',
						),
			'kangmoyaoqiu'=>array(
						'type'=>'radio',
						'options'=>array("1"=>"有","2"=>"无",3=>"要求“极压+抗磨”" ,4=>"不知道" ),
						//'empty'=>'抗磨要求',
						'class'=>'input_w1',
						),
			'diqu'=>array(
						'type'=>'select',
						'options'=>array(1=>"华东"  ,2=>"华南" ,3=>"华中" ,4=>"华北" ,5=>"西南" ,6=>"西北"  ,7=>"东北" ),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'必填项',
						),
			'qingjiedu'=>array(
						'type'=>'select',
						'options'=>array(1=>"4级"  ,2=>"5级" ,3=>"6级" ,4=>"7级" ,5=>"8级" ,6=>"9级"  ,7=>"10级" ,8=>"没要求" ,9=>"不知道"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'按NAS等级',
						'note'=>'按NAS等级',
						),
			'xuanyoumudi'=>array(
						'type'=>'radio',
						'options'=>array("1"=>"不知当前设备该用什么润滑剂","2"=>"对目前润滑效果不满意",3=>"润滑效果还行，但还想更进一步" ,4=>"对当前润滑剂是否正确进行核实验证" ,5=>"多找几种方案做备胎"),
						//'empty'=>'选油目的',
						'class'=>'input_w1',
						),
			'max'=>array(
						'type'=>'select',
						'options'=>array(1=>"10"  ,2=>"20" ,3=>"30" ,4=>"40" ,5=>"50" ,6=>"60"  ,7=>"70" ,8=>"80" ,9=>"90",10=>"100" ,11=>"120"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'必填项',
						),
			'min'=>array(
						'type'=>'select',
						'options'=>array(1=>"20"  ,2=>"10" ,3=>"0" ,4=>"一10" ,5=>"一20" ,6=>"一30"  ,7=>"一40" ,8=>"≤一41"),
						//'empty'=>'必填项',
						'class'=>'u_select_opty',
						'dnote'=>'必填项',
						),
			'runhuayongtu'=>array(
						'type'=>'radio',
						'options'=>array("A"=> "液压系统" , "B"=> "齿轮" , "C"=> "轴承"  ,"D"=> "数控设备" ,"E" =>"精密机械" ,"F"=> "钢索" , "G" =>"其它"),
						'empty'=>'润滑剂用途',
						'class'=>'input_w1',
						),
			'runhuayongyu'=>array(
						'type'=>'radio',
						'options'=>array("A"=> "新设备" , "B"=> "为在用设备寻觅更好方案" , "C"=> "对现用油品不满意，想替换 "  ),
						'empty'=>'润滑剂用于',
						'class'=>'input_w1',
						),
			
			);
		$f = new Form($field, "/first.html");
		$this->smarty->assign("form", $f->getForm($_SESSION['post']));
		$this->smarty->display("www/first.html");
	}

	public function startoneAction(){
		if($_SESSION["type"]!==1){
			echo '<script type="text/javascript">top.location.href="/first.html";</script>';
			exit;
		}
		if($_POST)
		{	
			//存入session
			$post = $_POST;
			//参数检查
			$error = $this->user_postModule->checkOnePost($post);
			if($error==-1){
				$result = "很抱歉，本系统暂未收录您需要的润滑剂资料,建议您直接联系本系统专家团队获取解决方案";
				//记录日志
				$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result, "",$post,1);
			}
			if($id)
			{	
				echo '<script type="text/javascript">top.location.href="/startn.html?id='.$id.'";</script>';
				exit;
			}
			$result = $this->user_postModule->findResult($_SESSION["post"],$post,1);
			$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result['result'], $result['sql'],$post,1);
			//结果过多
			if($result['ret'] < 1)
			{
				echo '<script type="text/javascript">top.location.href="/startn.html?id='.$id.'";</script>';
				exit;
			}

			//正确结果
			else
			{
				echo '<script type="text/javascript">top.location.href="/starty.html?id='.$id.'&type='.$result["ret"].'";</script>';
			}
		}
		Common::load("Form");
		$field = array(
			'anquanyaoqiu'=>array(
						'type'=>'radio',
						'options'=>array("A"=>"抗燃","B"=>"难燃","C"=>"没特别要求"),
						//'empty'=>'安全要求',
						'class'=>'input_w1',
						),
			'gongzuochangsuo'=>array(
						'type'=>'radio',
						'options'=>array("A"=>"室内","B"=>"室外","C"=>"室内室外皆有 "),
						//'empty'=>'工作场所',
						'class'=>'input_w1',
						),
			'max_yali'=>array(
						'type'=>'text',
						'check'=>'Temperature',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'max_yali_1'=>array(
						'type'=>'text',
						'check'=>'Temperature',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'min_yali'=>array(
						'type'=>'text',
						'check'=>'Temperature',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'zhugongleixing'=>array(
						'type'=>'radio',
						'options'=>array("A"=>"叶片泵","B"=>"柱塞泵","C"=>"齿轮泵 ","D"=>"螺杆泵"),
						//'empty'=>'主泵类型',
						'class'=>'input_w1',
						),
			'liuliang_1'=>array(
						'type'=>'text',
						'check'=>'Temperature',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'liuliang_1_1'=>array(
						'type'=>'text',
						'check'=>'Temperature',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'liuliang_2'=>array(
						'type'=>'text',
						'check'=>'Temperature',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'liuliang_2_2'=>array(
						'type'=>'text',
						'check'=>'Temperature',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'liuliang_3'=>array(
						'type'=>'text',
						'check'=>'Temperature',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'dnote'=>'必填项',
						),
			'fazhuleixing'=>array(
						'type'=>'radio',
						'options'=>array("A"=>"有伺服阀","B"=>"有比例阀"),
						//'empty'=>'阀组类型',
						'class'=>'input_w1',
						),
			'zhixingyuanjian'=>array(
						'type'=>'text',
						'check'=>'Temperature',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'note'=>'请输入',
						'dnote'=>'系统执行元件最大线速度m/s',
						),
			'zhixingyuanjian_1'=>array(
						'type'=>'text',
						'check'=>'Temperature',
						//'empty'=>'必填项',
						'class'=>'text w1',
						'note'=>'请输入',
						'dnote'=>'系统执行元件最大线速度m/s',
						),
			'yuanjianqingkuang'=>array(
						'type'=>'radio',
						'options'=>array("A"=>"系统元件有含铜","B"=>"系统元件有含银"),
						//'empty'=>'元件情况',
						'class'=>'input_w1',
						),
			'runhuayongqiu'=>array(
						'type'=>'radio',
						'options'=>array("A"=>"液压系统与导轨润滑共用","B"=>"液压系统与齿轮润滑共用 "),
						//'empty'=>'润滑要求',
						'class'=>'input_w1',
						),
			'xitongyaoqiu'=>array(
						'type'=>'radio',
						'options'=>array("A"=>"无灰液压油","B"=>"抗磨液压油","C"=>"合成液压油 ","D"=>"低温型液压油","E"=>"高温型液压油"),
						//'empty'=>'系统要求',
						'class'=>'input_w1',
						),
			'gongzuozhuangtai'=>array(
						'type'=>'radio',
						'options'=>array("A"=>"间歇 ","B"=>"连续","C"=>"变速 ","D"=>"冲击"),
						//'empty'=>'工作状态',
						'class'=>'input_w1',
						),
			);
		$f = new Form($field, "/start_1.html");
		$this->smarty->assign("form", $f->getForm($_SESSION['post']));
		$this->smarty->display("www/start_1.html");
	}
	public function startTwoAction(){
		if($_SESSION["type"]!==1){
			echo '<script type="text/javascript">top.location.href="/first.html";</script>';
			exit;
		}
		if($_POST)
		{	
			//存入session
			$post = $_POST;
			$result = "很抱歉，本系统暂未收录您需要的润滑剂资料";
			$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result, "",$post,2);
			
			//结果过多
			if($result['ret'] != '1')
			{
				echo '<script type="text/javascript">top.location.href="/find_err.html?id='.$id.'";</script>';
				exit;
			}
		}
		Common::load("Form");
		$field = array(
			'pinpai' => array(
				'type'=>'radio',
				'options'=>array("1"=> "美孚" , "2"=> "壳牌" , "3"=> "长城"  ,"4"=> "昆仑" ,"5" =>"其它"),
				'dnote'=>'可多选，无则无需选择',
				'class'=>'input_w1',
				),
			'guigexinghao' => array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1',
				'note'=>'请输入',
				'dnote'=>'请务必填写完整，如“长城卓力L-HS超低温液压油32#',
				),
			'niandudengji'=>array(
				'type'=>'select',
				'options'=>array(1=>"10"  ,2=>"15" ,3=>"22" ,4=>"32" ,5=>"46" ,6=>"68"  ,7=>"100"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'请输入',
				),
			'shijiqingkuang'=>array(
				'type'=>'checkbox',
				'options'=>array(
					"1" => "执行元件或阀组的动作偶有失灵" ,
					"2" => "精密阀组失效（卡死或磨损）快，更换周期太短" , 
					"3" => "油温高时动作慢"  ,
					"4" => "油温低时动作慢" ,
					"5" => "漏油严重" ,
					"6" => "滤芯总堵，更换周期短" ,
					"7" => "新油使用不长一段时间后，压力或流量下降较大" ,
					"8" => "液压密封件更换频繁" ,
					"9" => "经常高温报警" ,
					"10" => "液压油更换周期太短" ,
					"11" => "液压元件磨损严重",
					"12" => "液压元件表面有腐蚀或锈蚀现象",
					"13" => "新油不长时间后，粘度很快升高",
					"14" => "新油不长时间后，粘度很快下降",
					"15" => "新油不长时间后，出现浑浊甚至恶臭味",
					"16" => "温度高时泄漏量太大",
					"17" => "温度低时噪声很大",
					"18" => "现用油品太贵了，想找更高性价比的",
					),
				'dnote'=>'可多选，无则无需选择',
				'class'=>'input_w1',
				),
			);
		$f = new Form($field, "/start_2.html");
		$this->smarty->assign("form", $f->getForm($_SESSION['post']));
		$this->smarty->display("www/start_2.html");
	}
	public function startThreeAction(){
		if($_SESSION["type"]!==1){
			echo '<script type="text/javascript">top.location.href="/first.html";</script>';
			exit;
		}
		if($_POST)
		{	
			//存入session
			$post = $_POST;
			//参数检查
			$error = $this->user_postModule->checkThreePost($post);
			if($error==-1){
				$result = "很抱歉，本系统暂未收录您需要的润滑剂资料";
				//记录日志
				$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result, "",$post,3);
			}
			if($id)
			{	
				echo '<script type="text/javascript">top.location.href="/startn.html?id='.$id.'";</script>';
				exit;
			}
			
			$result = $this->user_postModule->findResult($_SESSION["post"],$post,3);

			$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result['result'], $result['sql'],$post,3);
			//结果过多
			if($result['ret'] < 1)
			{
				echo '<script type="text/javascript">top.location.href="/startn.html?id='.$id.'";</script>';
				exit;
			}

			//正确结果
			else
			{
				echo '<script type="text/javascript">top.location.href="/starty.html?id='.$id.'&type='.$result["ret"].'";</script>';
			}
		}
		Common::load("Form");
		$field = array(
			'cixing'=>array(
				'type'=>'checkbox',
				'options'=>array("A"=>"直齿","D"=>"圆锥直齿","B"=>"斜齿","C"=>"人字齿","E"=>"螺旋伞齿","F"=>"准双曲面齿","G"=>"蜗轮蜗杆"),
				//'empty'=>'必填项',
				'class'=>'input_w1',
				'dnote'=>'可多选，无则不选',
				),
			'chuandongfangshi'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"开式齿轮传动（没有防尘罩或机壳，齿轮完全暴露在外面）","B"=>"半开式齿轮传动（有简单防护罩，但仍不能做到严密防止外界杂物侵入）","C"=>"闭式齿轮传动（齿轮传动在封闭严密的环境内，外界杂物很难侵入）"),
				//'empty'=>'传动方式',
				'class'=>'input_w1',
				),
			"chuandongbi" =>array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1',
				'note'=>'请输入',
				),
			"chuandongbi_1" =>array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1',
				'note'=>'请输入',
				),
			"chuandonggonglu" =>array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1',
				'note'=>'请输入',
				),
			"chuandonggonglu_1" =>array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1',
				'note'=>'请输入',
				),
			'ciluncaizhi'=>array(
				'type'=>'select',
				'options'=>array("A"=>"胶木","B"=>"塑料","C"=>"铸铁","D"=>"铸钢","E"=>"低碳钢","F"=>"中碳钢","G"=>"合金钢","H"=>"青铜合金"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'cilunfuhe'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"轻载","B"=>"中载","C"=>"重载"),
				//'empty'=>'运动状况',
				'class'=>'input_w1',
				),
			"cilunmoshu" =>array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1 fl',
				'note'=>'请输入',
				),
			"cilunmoshu_1" =>array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1 fl',
				'note'=>'请输入',
				),
			"jiechuyingli" =>array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1 fl',
				'note'=>'请输入',
				),
			"jiechuyingli_1" =>array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1 fl',
				'note'=>'请输入',
				),
			'zuidayingdu'=>array(
				'type'=>'select',
				'options'=>array("A"=>"HBS","B"=>"HRC"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'hbs'=>array(
				'type'=>'select',
				'options'=>array(1=>"≤238",  2=>"≤350", 3=>"≤508",  4=>"≤612",  5=>">612"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'hrc'=>array(
				'type'=>'select',
				'options'=>array(1=>"≤22",2=>"≤38",3=>"≤52",4=>"≤58",5=>">58"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'hbs_1'=>array(
				'type'=>'select',
				'options'=>array(1=>"≤238",  2=>"≤350", 3=>"≤508",  4=>"≤612",  5=>">612"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				// 'dnote'=>'必填项',
				),
			'hrc_1'=>array(
				'type'=>'select',
				'options'=>array(1=>"≤22",2=>"≤38",3=>"≤52",4=>"≤58",5=>">581"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				// 'dnote'=>'必填项',
				),
			"yuanxiansudu" =>array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1 fl',
				'note'=>'请输入',
				),
			"yuanxiansudu_1" =>array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1 fl',
				'note'=>'请输入',
				),
			'runhuafangshi'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"脂润滑 ","B"=>"喷油润滑","C"=>"滴油润滑 ","D"=>"油浴润滑（含浸油、飞溅等）","E"=>"油雾润滑","F"=>"油气润滑"),
				//'empty'=>'润滑方式',
				'class'=>'input_w1',
				),
			'yundongzhuangkuang'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"连续平稳运动 ","B"=>"间歇较平稳运动","C"=>"较大冲击运动"),
				//'empty'=>'运动状况',
				'class'=>'input_w1',
				),
			'tesuyaoqiu'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"环保 ","B"=>"毒性小","C"=>"防辐射","D"=>"可食用","E"=>"其它"),
				//'empty'=>'特殊要求',
				'class'=>'input_w1',
				),
			'jiechujiezhi'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"腐蚀性","B"=>"潮湿","C"=>"低温≤一20℃","D"=>"高温>60℃","E"=>"污水","F"=>"蒸汽","G"=>"灰尘","H"=>"颗粒","L"=>"振动大","K"=>"其它特殊介质或极端工况"),
				//'empty'=>'特殊要求',
				'class'=>'input_w1',
				),
			'gongzuochangsuo'=>array(
				'type'=>'radio',
				'options'=>array("1"=>"室内","2"=>"室外"),
				//'empty'=>'请选择工作场所',
				'class'=>'input_w1',
				),
			);
		$f = new Form($field, "/start_3.html");
		$this->smarty->assign("form", $f->getForm($_SESSION['post']));
		$this->smarty->display("www/start_3.html");
	}
	public function startFourAction(){
		if($_SESSION["type"]!==1){
			echo '<script type="text/javascript">top.location.href="/first.html";</script>';
			exit;
		}
		if($_POST)
		{	
			//存入session
			$post = $_POST;
			$result = "很抱歉，本系统暂未收录您需要的润滑剂资料";
			$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result, "",$post,4);
			
			//结果过多
			if($result['ret'] != '1')
			{
				echo '<script type="text/javascript">top.location.href="/find_err.html?id='.$id.'";</script>';
				exit;
			}
		}
		Common::load("Form");
		$field = array(
			'pinpai' => array(
				'type'=>'radio',
				'options'=>array("1"=> "美孚" , "2"=> "壳牌" , "3"=> "长城"  ,"4"=> "昆仑" ,"5" =>"其它"),
				'dnote'=>'可多选，无则无需选择',
				'class'=>'input_w1',
				),
			'guigexinghao' => array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1',
				'note'=>'请输入',
				'dnote'=>'请务必填写完整，如“长城得威工业齿轮油AP-S460”',
				),
			'niandudengji'=>array(
				'type'=>'select',
				'options'=>array(1=>"22"  ,2=>"32" ,3=>"46" ,4=>"68" ,5=>"100" ,6=>"150"  ,7=>"220",8=>"320" ,9=>"460" ,10=>"680" ,11=>"1000"  ,12=>"1500"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'请输入',
				),
			'shijiqingkuang'=>array(
				'type'=>'checkbox',
				'options'=>array(
					"1" => "齿面有点蚀" ,
					"2" => "齿面有胶合" , 
					"3" => "齿面有擦伤"  ,
					"4" => "齿面有磨损" ,
					"5" => "齿面有撞击现象" ,
					"6" => "粘度变化大" ,
					"7" => "振动严重，减震不好" ,
					"8" => "噪声较大" ,
					"9" => "密封效果不好，泄漏严重" ,
					"10" => "润滑油脏得快，换油周期短" ,
					"11" => "新油不长时间后，粘度很快减小",
					"12" => "新油不长时间后，粘度很快增大",
					"13" => "易过热，降温冷却不好",
					"14" => "沉淀和油泥增加快",
					"15" => "润滑剂浑浊、起泡、异味大，易变质",
					"16" => "油路易堵（新油不堵）",
					"17" => "油品过滤困难",
					"18" => "精密部件容易失灵，卡死或不动，换新油也不行",
					"19" => "齿面有锈蚀或腐蚀现象",
					"20" => "泄漏令人头疼，其它还好",
					"21" => "油品使用寿命短，换油太快",
					"22" => "温度高时泄漏量太大或噪声大",
					"23" => "温度低时噪声大，甚至干摩擦",
					"24" => "需要经常补充加油，而补充加油又很不方便",
					"25" => "现用润滑剂太贵  问询专家",
					),
				'dnote'=>'可多选，无则无需选择',
				'class'=>'input_w1',
				),
			);
		$f = new Form($field, "/start_4.html");
		$this->smarty->assign("form", $f->getForm($_SESSION['post']));
		$this->smarty->display("www/start_4.html");
	}
	public function startFiveAction(){
		if($_SESSION["type"]!==1){
			echo '<script type="text/javascript">top.location.href="/first.html";</script>';
			exit;
		}
		if($_POST)
		{	
			//存入session
			$post = $_POST;
			$error = $this->user_postModule->checkFivePost($post);
			//参数检查
			if($error==-1){
				$result = "很抱歉，本系统暂未收录您需要的润滑剂资料";
				//记录日志
				$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result, "",$post,5);
			}
			if($id)
			{	
				echo '<script type="text/javascript">top.location.href="/find_err.html?id='.$id.'";</script>';
				exit;
			}
			
			$result = $this->user_postModule->findResult($_SESSION["post"],$post,5);

			$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result['result'], $result['sql'],$post,5);
			//结果过多
			if($result['ret'] < 1)
			{
				echo '<script type="text/javascript">top.location.href="/startn.html?id='.$id.'";</script>';
				exit;
			}

			//正确结果
			else
			{
				echo '<script type="text/javascript">top.location.href="/starty.html?id='.$id.'&type='.$result["ret"].'";</script>';
			}
		}
		Common::load("Form");
		$field = array(
			'zuidayingdu'=>array(
				'type'=>'select',
				'options'=>array("A"=>"A ","B"=>"B"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'hbs'=>array(
				'type'=>'select',
				'options'=>array(1=>"≤238",  2=>"≤350", 3=>"≤508",  4=>"≤612",  5=>">612"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'hrc'=>array(
				'type'=>'select',
				'options'=>array(1=>"≤22",2=>"≤38",3=>"≤52",4=>"≤58",5=>">58"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'hbs_1'=>array(
				'type'=>'select',
				'options'=>array(1=>"≤238",  2=>"≤350", 3=>"≤508",  4=>"≤612",  5=>">612"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				// 'dnote'=>'必填项',
				),
			'hrc_1'=>array(
				'type'=>'select',
				'options'=>array(1=>"≤22",2=>"≤38",3=>"≤52",4=>"≤58",5=>">58"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				// 'dnote'=>'必填项',
				),
			'runhuasudu'=>array(
				'type'=>'select',
				'options'=>array(1=>"≤0.1",2=>"≤0.5",3=>"≤1.3",4=>"≤2.5",5=>"≤4",6=>"≤5",7=>"≤12.5",8=>"≤16",9=>"≤25",10=>">25"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'runhuasudu_1'=>array(
				'type'=>'select',
				'options'=>array(1=>"≤0.1",2=>"≤0.5",3=>"≤1.3",4=>"≤2.5",5=>"≤4",6=>"≤5",7=>"≤12.5",8=>"≤16",9=>"≤25",10=>">25"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'runhuacucao'=>array(
				'type'=>'select',
				'options'=>array("A"=>"≤Ra0.8","B"=>"≤Ra3.2","C"=>"≤Ra12.5","D"=>">Ra12.5"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'runhuacucao_1'=>array(
				'type'=>'select',
				'options'=>array("A"=>"≤Ra0.8","B"=>"≤Ra3.2","C"=>"≤Ra12.5","D"=>">Ra12.5"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'zuixiaojianxi'=>array(
				'type'=>'select',
				'options'=>array("A"=>"≤0.05","B"=>"≤0.1","C"=>">0.1"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'zuixiaojianxi_1'=>array(
				'type'=>'select',
				'options'=>array("A"=>"≤0.05","B"=>"≤0.1","C"=>">0.1"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'必填项',
				),
			'jiechuleixing'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"点线接触","B"=>"面接触"),
				//'empty'=>'润滑部位接触类型',
				'class'=>'input_w1',
				),
			'yundongxingshi'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"纯滚动","B"=>"纯滑动","C"=>"既滚动又滑动"),
				//'empty'=>'润滑部位相对运动形式',
				'class'=>'input_w1',
				),
			'yundongfangxiang'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"水平运动","B"=>"垂直运动","C"=>"倾斜运动"),
				//'empty'=>'润滑部位相对运动方向',
				'class'=>'input_w1',
				),
			'yundongfangshi'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"匀速","B"=>"变速","C"=>"间歇"),
				//'empty'=>'润滑部位相对运动方式',
				'class'=>'input_w1',
				),
			'runhuabuwei'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"含铜","B"=>"含银"),
				//'empty'=>'润滑部位',
				'class'=>'input_w1',
				),
			'runhuafangshi'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"脂润滑","B"=>"喷油润滑","C"=>"滴油润滑","D"=>"油浴润滑（含浸油、飞溅等）","E"=>"油雾润滑","F"=>"油气润滑"),
				//'empty'=>'润滑方式 ',
				'class'=>'input_w1',
				),
			'buweifanghu'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"全裸露，无防护","B"=>"半敞开，非完全防护","C"=>"全封闭"),
				//'empty'=>'润滑部位防护 ',
				'class'=>'input_w1',
				),
			'yundongqingkuang'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"运行平稳","B"=>"运行有冲击","C"=>"有强烈冲击"),
				//'empty'=>'润滑部位运动情况 ',
				'class'=>'input_w1',
				),
			'zhendongqingkuang'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"无振动","B"=>"有振动","C"=>"剧烈振动"),
				//'empty'=>'润滑部位振动情况 ',
				'class'=>'input_w1',
				),
			'buweichengzai'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"轻载","B"=>"中载","C"=>"重载"),
				//'empty'=>'润滑部位承载 ',
				'class'=>'input_w1',
				),
			'jiechujiezhi'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"腐蚀性","B"=>"潮湿","C"=>"低温≤一20℃","D"=>"高温≥60℃","E"=>"污水","F"=>"蒸汽","G"=>"灰尘","H"=>"颗粒","L"=>"振动大",  "K"=>"其它特殊介质或极端工况"),
				//'empty'=>'润滑部位接触介质',
				'class'=>'input_w1',
				),
			'gongzuochangsuo'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"室内","B"=>"室外"),
				//'empty'=>'工作场所 ',
				'class'=>'input_w1',
				),
			'tesuyaoqiu'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"环保 ","B"=>"毒性小","C"=>"防辐射","D"=>"可食用","E"=>"其它"),
				//'empty'=>'特殊要求',
				'class'=>'input_w1',
				),
			'buweicaizhi'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"塑料","B"=>"铸铁","C"=>"铸钢","D"=>"低碳钢","E"=>"中碳钢","F"=>"合金钢","G"=>"青铜合金","H"=>"其他"),
				//'empty'=>'润滑部位材质',
				'class'=>'input_w1',
				),
			'mochaleixing'=>array(
				'type'=>'radio',
				'options'=>array("A"=>"流体润滑","B"=>"边界润滑","C"=>"混合润滑（流体润滑+边界润滑）"),
				//'empty'=>'摩擦类型',
				'class'=>'input_w1',
				),
			);
		$f = new Form($field, "/start_5.html");
		$this->smarty->assign("form", $f->getForm($_SESSION['post']));
		$this->smarty->display("www/start_5.html");
	}
	public function startSixAction(){
		if($_SESSION["type"]!==1){
			echo '<script type="text/javascript">top.location.href="/first.html";</script>';
			exit;
		}
		if($_POST)
		{	
			//存入session
			$post = $_POST;
			$result = "很抱歉，本系统暂未收录您需要的润滑剂资料";
			$id = $this->user_postlogModule->add($_COOKIE['PHPSESSID'], $_SESSION['post'], $result, "",$post,6);
			
			//结果过多
			if($result['ret'] != '1')
			{
				echo '<script type="text/javascript">top.location.href="/find_err.html?id='.$id.'";</script>';
				exit;
			}
		}
		Common::load("Form");
		$field = array(
			'pinpai' => array(
				'type'=>'radio',
				'options'=>array("1"=> "美孚" , "2"=> "壳牌" , "3"=> "长城"  ,"4"=> "昆仑" ,"5" =>"其它"),
				'dnote'=>'可多选，无则无需选择',
				'class'=>'input_w1',
				),
			'guigexinghao' => array(
				'type'=>'text',
				'check'=>'Temperature',
				//'empty'=>'必填项',
				'class'=>'text w1',
				),
			'niandudengji'=>array(
				'type'=>'select',
				'options'=>array(1=>"22"  ,2=>"32" ,3=>"46" ,4=>"68" ,5=>"100" ,6=>"150"  ,7=>"220",8=>"320" ,9=>"460" ,10=>"680" ,11=>"1000"  ,12=>"1500"),
				//'empty'=>'必填项',
				'class'=>'u_select_opty',
				'dnote'=>'请输入',
				),
			'shijiqingkuang'=>array(
				'type'=>'checkbox',
				'options'=>array(
					"1" => "润滑部位有锈迹" ,
					"2" => "润滑部位有腐蚀" , 
					"3" => "润滑部位磨损现象严重"  ,
					"4" => "润滑部位高温时噪声大" ,
					"5" => "润滑部位低温时噪声大" ,
					"6" => "润滑部位振动大" ,
					"7" => "润滑部位温度偏高" ,
					"8" => "润滑剂脏得快" ,
					"9" => "润滑剂消耗太快" ,
					"10" => "润滑剂新换不久就浑浊、变味、变质、有沉淀或油泥" ,
					"11" => "润滑剂高温时太稀，或低温时太稠",
					"12" => "泄漏令人头疼，其它还好",
					"13" => "希望能长时间不换润滑剂",
					"14" => "现用油品太贵了，想找更高性价比的",
					),
				'dnote'=>'可多选，无则无需选择',
				'class'=>'input_w1',
				),
			);
		$f = new Form($field, "/start_6.html");
		$this->smarty->assign("form", $f->getForm($_SESSION['post']));
		$this->smarty->display("www/start_6.html");
	}

	public function findErrAction()
	{	
		$aRes = $this->user_postlogModule->getLog(intval($_GET['id']));
		$this->smarty->assign("type", is_numeric(strpos($aRes['result'][0], "太少")));
		$this->smarty->assign("id", intval($_GET['id']));
		$this->smarty->assign("result", $aRes['result'][0]);
		$this->smarty->display("www/start_err.html");
	}
}
?>